package com.kmdd.xtds.ui

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import com.gyf.immersionbar.ktx.immersionBar
import com.kmdd.xtds.databinding.ActivityFeedbackBinding
import com.kmdd.xtds.toast

class FeedbackActivity : AppCompatActivity() {
    private lateinit var binding: ActivityFeedbackBinding

    companion object {

        fun start(context: Context) {
            context.startActivity(Intent(context, FeedbackActivity::class.java))
        }

    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityFeedbackBinding.inflate(layoutInflater)
        setContentView(binding.root)
        immersionBar {
            transparentBar()
            keyboardEnable(true)
            fitsSystemWindows(false)
            statusBarDarkFont(false)
        }


        binding.frameLayoutBack.setOnClickListener {
            finish()
        }

        binding.tvSave.setOnClickListener {

            val content = binding.editContent.text
            if (TextUtils.isEmpty(content)) {
                toast("请输入反馈内容")
                return@setOnClickListener
            }

            toast("提交成功")
            finish()
        }
    }
}